<template>
    <div class="external">
        <div class="header">
            <img src="../../images/header.png" alt="">
            <div class="downbtn">
                <a :href="this.url"> </a>
            </div>
        </div>
        <div class="backdrop">
            <img src="../../images/landingPagesm.png" alt="">
            <div class="banner">
                <el-carousel :interval="4000" type="card" height="200px">
                    <el-carousel-item>
                        <img src="../../images/first.png" alt="">
                    </el-carousel-item>
                    <el-carousel-item>
                        <img src="../../images/second.png" alt="">
                    </el-carousel-item>
                    <el-carousel-item>
                        <img src="../../images/third.png" alt="">
                    </el-carousel-item>
                    <el-carousel-item>
                        <img src="../../images/four.png" alt="">
                    </el-carousel-item>
                    <el-carousel-item>
                        <img src="../../images/five.png" alt="">
                    </el-carousel-item>
                </el-carousel>
            </div>
        </div>
        <div class="download" @click="androiddown">
            <a :href="this.url"> </a>
        </div>
        <div class="downbottom" @click="androiddown">
            <a :href="this.url"> </a>
        </div>
       
    </div>
</template>

<script>0
export default {
  name: 'home',
  components: {},
  created() {
     
 
    var u = navigator.userAgent
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1 //android终端
    var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) //ios终端
    var ua = navigator.userAgent.toLowerCase();	
	if (/iphone|ipad|ipod/.test(ua)) {
		  	isiOS = true;
	} 
    if (isiOS) {
      this.isotype = true,
        this.url =
          'itms-services://?action=download-manifest&url=https://ios.miyugame.com/ios_ipa/1280_ipa.plist'
    }
  },
  data() {
    return {
      isotype: false,
      items: [],
      url:
        'http://cdn.package.miyugame.com/1333/1000_1333_my_wushenzhaozilong_1.0.1.apk'
    }
  },
  methods: {
    androiddown() {
      if (this.isotype) {
        window.location.href =
          'http://cdn.package.miyugame.com/1333/1000_1333_my_wushenzhaozilong_1.0.1.apk'
      } else {
        window.location.href =
          'http://cdn.package.miyugame.com/1333/1000_1333_my_wushenzhaozilong_1.0.1.apk'
      }
    }
  }
}
</script>

<style lang="less" scoped>
.external {
  position: relative;
  .header {
    position: fixed;
    top: 0;
    z-index: 1;
    width: 100%;
    img {
      width: 100%;
    }
    .downbtn {
      width: 30%;
      height: 36%;
      background: url(../../images/downbth.png) repeat;
      background-size: 100% 100%;
      position: absolute;
      right: 1rem;
      top: 1rem;
      a {
        display: inline-block;
        width: 100%;
        height: 100%;
      }
    }
  }
  .backdrop {
    height: 100%;
    img {
      width: 100%;
      height: 100%;
    }
    .banner {
      width: 100%;
      position: absolute;
      top: 67%;
      display: flex;
      align-content: center;
      justify-content: center;
      background: url(../../images/frameback.png) no-repeat;
      background-size: 100% 100%;
      height: 25%;
    }
  }
}
.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 200px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
.download {
  height: 3%;
  width: 44%;
  background: url(../../images/downbth.png) no-repeat;
  background-size: 100% 100%;
  position: absolute;
  top: 40%;
  left: 30%;
  a {
    display: inline-block;
    width: 100%;
    height: 100%;
  }
}
.downbottom {
  height: 3%;
  width: 44%;
  background: url(../../images/downbth.png) no-repeat;
  background-size: 100% 100%;
  position: absolute;
  left: 29%;
  bottom: 7%;
  a {
    display: inline-block;
    width: 100%;
    height: 100%;
  }
}

</style>
<style>
.el-carousel {
  width: 75%;
  padding-top: 22%;
}

</style>
